package com.zywl.core.dao.mapper.sys;

import com.zywl.core.beans.Resource;
import com.zywl.core.dao.base.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ResourceMapper extends BaseMapper<Resource> {
    List<Resource> getResources(@Param("resType") String resType);

    List<Resource> getResourcesByRoleId(@Param("roleId") Long roleId, @Param("resType") String resType);

    Integer getMaxOrderByPid(Long pId);

    List<Resource> getAllDataEnable(String order);

    List<Resource> getAllByAssId(@Param("assId") Long assId);

    List<Resource> getAllByAssIdAndType(@Param("assId") Long assId ,@Param("resType") String resType);

    /**
     * 修改当前节点及其所有子节点的权限为不启用
     *
     * @param id
     * @throws Exception
     */
    void updateUnderResource(Long id) throws Exception;

    /**
     * 修改当前节点及其所有父节点的权限为启用，并且子节点也启用
     *
     * @param id
     * @throws Exception
     */
    void updateCorrelationResource(Long id) throws Exception;

}